#pragma once

#include <iostream>
#include <assert.h>
using namespace std;

class Date
{
public:
	bool CheckDate();

	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& in,Date& d);

	Date(int year, int month = 1, int day = 1);

	bool operator==(const Date& d2) const;

	bool operator<(const Date& d)const;

	bool operator<=(const Date& d)const;

	bool operator>(const Date& d)const;

	bool operator>=(const Date& d)const;
	bool operator!=(const Date& d)const;

	void Print() const;

	int GetMonthDay(int year, int month)const;

	Date& operator+=(int day);

	Date operator+(int day)const;

	Date& operator-=(int day);

	Date operator-(int day)const;

	int operator-(const Date& d)const;
	//++d1->d1.operator++()
	Date& operator++();
	//d1++->d1.operator++(0)
	Date operator++(int);

	Date& operator--();
	Date operator--(int);

	Date* operator&();

	const Date* operator&() const;

private:
	int _year;
	int _month;
	int _day;

	static int a;
};

ostream& operator<<(ostream& out, const Date& d);
istream& operator>>(istream& in, Date& d);

//int Date::a = 0;

//static int a = 0;